a=1
while a<=9:
    b=1
    while b<=a:
        print(f"{b}*{a} = {a*b}",end='')
        if a*b<10 and b>1 and b<4:
            print("  ",end='')
        else:
            print(" ",end='')
        b=b+1
    print()
    a=a+1

print()

for i in range(1,10):
    for j in range(1,i+1):
        print(f"{j}*{i} = {j*i}",end='')
        if j * i < 10 and j > 1 and j < 4:
            print("  ", end='')
        else:
            print(" ", end='')
        j = j + 1
    print()
    a = a + 1